# 定义编译器
CXX = g++

# 定义编译器标志
CXXFLAGS = -Wall -g -lpthread -std=c++17

# 定义源文件和目标文件
NUMS = 1 2 3 4 5 6
EXECUTABLES = $(foreach n,$(NUMS),concurrency$(n)) SingletonPattern Actor_and_CSP
SOURCES_CPP = $(addsuffix .cc, $(EXECUTABLES))

# 默认目标
all: $(EXECUTABLES)

# 定义规则
concurrency1: concurrency1.cc
	$(CXX) $(CXXFLAGS) -o concurrency1 concurrency1.cc

concurrency2: concurrency2.cc
	$(CXX) $(CXXFLAGS) -o concurrency2 concurrency2.cc

concurrency3: concurrency3.cc
	$(CXX) $(CXXFLAGS) -o concurrency3 concurrency3.cc

concurrency4: concurrency4.cc
	$(CXX) $(CXXFLAGS) -o concurrency4 concurrency4.cc

concurrency5: concurrency5.cc
	$(CXX) $(CXXFLAGS) -o concurrency5 concurrency5.cc

concurrency6: concurrency6.cc
	$(CXX) $(CXXFLAGS) -o concurrency6 concurrency6.cc

SingletonPattern: SingletonPattern.cc
	$(CXX) $(CXXFLAGS) -o SingletonPattern SingletonPattern.cc

Actor_and_CSP: Actor_and_CSP.cc
	$(CXX) $(CXXFLAGS) -o Actor_and_CSP Actor_and_CSP.cc

# 清理目标
clean:
	rm -f $(EXECUTABLES)
